home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
who.arc
/
WHO.C
next >
Wrap
Text File
|
1987-10-13
|
1KB
|
67 lines
/********************************************************************
WHO.C
Alternate menu function for Novell Netware
First code : 10/13/87
********************************************************************/
#include <stdio.h>
#include <dos.h>
union REGPACK r;
struct {
int length ;
char function;
char station ;
} outpacket ;
struct {
int length ;
char uniqueid[4] ;
int type ;
char objectname[48] ;
char logtime[8] ;
} whoami ;
struct {
int length ;
char network[4] ;
char host[6] ;
char socket[2] ;
} map ;
main()
{
int count,station,physical ;
r.r_ds=_DS ;
r.r_es=_DS ;
r.r_ax=(0xdc00) ;
intr(0x21,&r) ;
station=(r.r_ax & 0xff) ;
r.r_ax=(0xee00) ;
intr(0x21,&r) ;
physical=r.r_ax ;
r.r_si=(int)&outpacket ;
r.r_di=(int)&whoami ;
r.r_ax= (0xe300) ;
whoami.length=sizeof(whoami) ;
outpacket.length=sizeof(outpacket) ;
outpacket.function=22 ;
outpacket.station=station ;
intr(0x21,&r) ;
r.r_si=(int)&outpacket ;
r.r_di=(int)&map ;
r.r_ax=0xe300 ;
outpacket.length=sizeof(outpacket) ;
outpacket.function=19 ;
outpacket.station=station ;
map.length=sizeof(map) ;
intr(0x21,&r) ;
physical=map.host[5] ;
printf("You are user %s, at station %i, connection %i.\n",
whoami.objectname,station,physical) ;
}